<template>
    <div class="d-flex align-items-center justify-content-between">
        <el-tooltip v-if="$attrs.info" class="box-item" effect="light" :content="$attrs.info">
            <i class="me-2 fa fa-info-circle"></i>
        </el-tooltip>
        <el-input type="text" v-bind="$attrs" v-model="inputValue" />
        <el-button class="ms-1" :type="$attrs.btnType" @click="onclick">{{ $attrs.text }}</el-button>

    </div>
</template>
<script setup>
import { ref, defineEmits } from 'vue';
const inputValue = ref('');
const emit = defineEmits(['change']);
const onclick = () => {
    if (inputValue.value === '') return;
    emit('change', inputValue.value);
    inputValue.value = '';
};
</script>